package com.shushan.network;

import android.content.Context;

import com.android.net.url.UrlParse;
import com.shushan.base.Constants;
import com.shushan.util.DeviceUtil;
import com.shushan.util.SharedPreferencesUtils;
import com.shushan.util.SystemUtils;


/**
 * @ClassName: UrlCommParse
 * @Desciption: UrlParse 封装
 * @author: yichaohua
 * @date: 2018-05-03
 */
public class UrlCommParse extends UrlParse {

    public UrlCommParse(Context context) {
        super();

        setDeviceInfo(context);
    }

    public UrlCommParse(Context context,String url) {
        super(url);

        setDeviceInfo(context);
    }

    private void setDeviceInfo(Context context) {

        mMap.put("shushan_device_type", DeviceUtil.getPhoneModel());
        mMap.put("shushan_app_version",DeviceUtil.getVersionName(context));
        mMap.put("shushan_system_version",DeviceUtil.getSystemVersion());
        mMap.put("shushan_system", Constants.OS_TYPE);
        mMap.put("shushan_device_id",DeviceUtil.getIMEI(context));
        mMap.put("shushan_phone", SharedPreferencesUtils.
                getStringDate(Constants.LOGIN_MOBILE_SHAREPREFERS_KEY));
        mMap.put("from", SystemUtils.getChannelName(context));
    }
}
